package com.tfswx.ruleengine.compute.bean;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @author Ricky
 * @date 2021/4/21
 */
@Data
public class Gzjyjg {
    private List<GzjyjgItem> gzjyjgItemList;
    private List<GzjyLog> gzjyLogList;
    private Long hchs;
    private String hcjgbh;
    private List<FormDataObject> data;

    public List<GzjyjgItem> getFxList() {
        if (gzjyjgItemList == null) {
            return new ArrayList<>();
        }
        return gzjyjgItemList.stream().filter(item -> "Y".equals(item.getSffx())).collect(Collectors.toList());
    }

    public int getHcsl() {
        if (gzjyjgItemList == null) {
            return 0;
        }
        return gzjyjgItemList.size();
    }
}
